﻿using System;
using System.Collections.Generic;

using UnityEngine;


public class YiguzuoqiCfgData : ImplData
{

    public class YiguzuoqiCfg
    {
        public string urlMansu = "";

        public string urlZhongsu = "";
        public string urlKuaisu = "";

        public string urlYanzousudu = "";

    }

    private Dictionary<string, YiguzuoqiCfg> d = new Dictionary<string, YiguzuoqiCfg>();

    protected override int Deserialize()
    {
        d.Clear();

        if (string.IsNullOrEmpty(jsonText))
            return -1;

        data = MiniJSON.Json.Deserialize(jsonText) as Dictionary<string, object>;

        foreach (var item in data)
        {

            YiguzuoqiCfg cfg = new YiguzuoqiCfg();

            Dictionary<string, object> dict = item.Value as Dictionary<string, object>;

            cfg.urlMansu = dict["mansu"] as string;
            cfg.urlZhongsu = dict["zhongsu"] as string;
            cfg.urlKuaisu = dict["kuaisu"] as string;
            cfg.urlYanzousudu= dict["yanzousudu"] as string;

            d.Add(item.Key, cfg);

        }

        return 0;
    }

    public YiguzuoqiCfg GetCfg(string id)
    {
        if (d.ContainsKey(id))
            return d[id];
        else
            return null;
    }



}


